<template id="main">
	<div class="main_personal">

		<!--头部-->
		<div class="main_header">
			<dl>
				<dt><img :src="center.headImage"/></dt>
				<dd>
					<p>{{center.username}}</p>

					<div class="main_revise">
						<router-link to="/edit_profile"><span>修改资料</span><img src="../../assets/images/main/revise_03.png" /></router-link>

					</div>

				</dd>
			</dl>

			<!--我的教练/代金券/课程券-->
			<div class="main_nav">
				<ul>
					<li @click.stop="mainCoach">

						<p>{{center.myCoachCount}}</p><span>我的教练</span>
					</li>
					<li>
						<div @click.stop="nextStep">
							<p>{{center.couponCount}}</p><span>优惠券</span></div>
					</li>

				</ul>

			</div>
			<!--我的教练/代金券/课程券结束-->

		</div>
		<!--头部结束-->

		<!--我的钱包-->
		<div class="main_detail">
			<div class="main_detail_left">
				<router-link :to="{path:'/main_money',query:{money:center.userWallet.money}}"><img src="../../assets/images/main/my_money.png" />
					<p>我的钱包</p>
				</router-link>
			</div>
			<div class="main_detail_right">
				<span>单次充值满</span>
				<font>1000</font>,<span>立返</span>
				<font>10%</font>
			</div>
		</div>
		<!--我的钱包结束-->

		<!--我的订单-->
		<div class="my_order">
			<div class="my_dota">
				<p>我的订单</p>
				<div class="my_dota_right">
					<!-- <router-link to="/doudle_routing"><span>查看全部订单</span><img src="../../assets/images/main/my_27.png" /></router-link> -->
				</div>
			</div>
		</div>
		<!--我的订单结束-->

		<!--未支付/已完成评价/未完成评价/共享瑜伽馆-->

		<div class="main_pay">
			<ul>
				<li @click.stop="pay">
					<img src="../../assets/images/main/my_20.png" />
					<p>待支付</p>
				</li>
				<li @click.stop="complete">

					<img src="../../assets/images/main/my_14.png" />
					<p>未完成</p>

				</li>
				<li @click.stop="rough">

					<img src="../../assets/images/main/my_17.png" />
					<p>已完成</p>

				</li>
				<li @click.stop="assess">

					<img src="../../assets/images/main/my_11.png" />
					<p>待评价</p>

				</li>
			</ul>
		</div>

		<!--未支付/已完成评价/未完成评价/共享瑜伽馆结束-->

		<!--成为教练/购物车/绑定邀请码/联系客服-->

		<div class="main_bunding">
			<ul>
				<li>
					<router-link to="/become_coach">
						<p>成为教练</p>
						<img src="../../assets/images/main/my_27.png" />
					</router-link>
				</li>
				<!--<li>
					<router-link to="/shop_cart">
						<p>我的购物车</p>
						<img src="../../assets/images/main/my_27.png" />
					</router-link>
				</li>-->
				<!--<li>
					<router-link to="/invitation_code">
						<p>绑定邀请码</p>
						<div class="main_active">
							<div class="main_active_kile"><img src="../../assets/images/main/my_31.png" /><span>我的邀请码:{{center.userWallet.userid}}</span></div>
							<img src="../../assets/images/main/my_27.png" />
						</div>
					</router-link>
				</li>-->
				<li>
					<router-link to="/about_us">
						<p>关于我们</p>
						<img src="../../assets/images/main/my_27.png" />
					</router-link>
				</li>
				<li>
					<router-link to="/contact_service">
						<p>联系客服解答投诉建议</p>
						<img src="../../assets/images/main/my_27.png" />
					</router-link>
				</li>
			</ul>
		</div>
		<!--成为教练/购物车/绑定邀请码/联系客服结束-->
       
	   <!-- 退出登陆按钮 -->
        <div>
			<div class="main_quit">
			<button @click.stop="logOff">退出登陆</button>
		</div>
		</div>
	   <!-- 退出登录按钮结束 -->


	</div>
</template>

<script>
	export default {
		data() {
			return {
				invite: [],
				coachid: this.$route.query.coachid,
				userid: 100343,
				code: 1,
				math: '',
				center:[],
				money:'',

			} 
		},
		created() {
			
				//let SESSION_ID = JSON.parse(window.sessionStorage.getItem('SESSION_ID'));
				var SESSION_ID=JSON.parse(window.localStorage.getItem('sessiond'))
				
				let obj = {
					sessionid: SESSION_ID.sessionid,
					userid: SESSION_ID.user.id,
				};
				let _this = this
				let qs = require('qs');
				this.$axios.post("http://yogahome.top/yujia/user/showPersonalCenter", qs.stringify(obj), {
					headers: {
						'Content-Type': 'application/x-www-form-urlencoded'
					}

				}).then(function(response) {

					// console.log(response.data.data)
					_this.center = response.data.data

				}).catch(function(error) {
					console.log(error);
				});
			
			
			
		},
		methods: {
			nextStep() {
				this.$router.push({
					path: '/coupon',
					query: {
						status: '2'
					}
				})
			},
			pay() {
				this.$router.push({
					path: '/doudle_pay',
					query: {}
				})
			},
			complete() {
				this.$router.push({
					path: '/doudle_air_complete',
					query: {}
				})
			},
			rough() {
				this.$router.push({
					path: '/doudle_already_complete',
					query: {}
				})
			},
			assess() {
				this.$router.push({
					path: '/doudle_assess',
					query: {}
				})
			},
			mainCoach() {
				this.$router.push({
					path: "/main_coach",
					query: {
						coachid: this.$route.query.coachid
					}
				})
			},
			logOff(){
				var SESSION_ID=JSON.parse(window.localStorage.getItem('sessiond'))
				window.localStorage.removeItem('sessiond')
				alert("退出登录成功")
				this.$router.push({
					path:'/main',
					query:{}
				})
			}
			

		}
	}
</script>

<style scoped>
	@import "../../assets/css/main.css";
</style>